home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97b.txt / 000005_icon-group-sender _Sat Jun 28 07:13:53 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Received: from kingfisher.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 30 Jun 1997 08:22:22 MST
  2. Received: by kingfisher.CS.Arizona.EDU; (5.65v3.2/1.1.8.2/08Nov94-0446PM)
  3.     id AA19571; Mon, 30 Jun 1997 08:22:22 -0700
  4. Posted-Date: Sat, 28 Jun 1997 07:13:53 -0500 (CDT)
  5. Date: Sat, 28 Jun 1997 07:13:53 -0500 (CDT)
  6. From: Chris Tenaglia <cdt@post.its.mcw.edu>
  7. To: icon-group@cs.arizona.edu
  8. Subject: kbhit & getch
  9. Message-Id: <Pine.SOL.3.96.970628070116.6031A-100000@post.its.mcw.edu>
  10. Mime-Version: 1.0
  11. Content-Type: TEXT/PLAIN; charset=US-ASCII
  12. Errors-To: icon-group-errors@cs.arizona.edu
  13. Status: RO
  14.  
  15. I wrote a game in icon and it worked well under DEC Ultrix.
  16. But it broke when we migrated to solaris. Here's the heart
  17. of the game loop:
  18.  
  19. repeat
  20.   {
  21.   draw_screen()  # draw the screen and score fields
  22.   animate()      # draw/undraw the sprites
  23.   sense()        # sense for shooting (keyboard keys)
  24.   }
  25. ...
  26. procedure sense()
  27.   kbhit() | fail
  28.   struck := getch()
  29.   ...
  30.   end
  31.  
  32. In the past :
  33. No Strike : kbhit would fail, then fail out of the procedure
  34. On Strike : the keyboard would be polled and the key would be
  35. sampled and processing would continue. The getch seemed to
  36. turn off the kbhit trap and it would go to No Strike mode again.
  37.  
  38. On the solaris system, it seems that once kbhit is tripped it
  39. stays tripped, never fails, and keeps getting stuck on the getch.
  40. Is there a different or better way of keyboard sampling or maybe
  41. a way to restore the prior behavior? Thanx in advance.
  42.  
  43. Chris Tenaglia   (system manager)     |  The future foretold,
  44. Medical College of Wisconsin          |  The past explained,
  45. 8701 W. Watertown Plank Rd.           |  The present largely appologized for.
  46. Milwaukee, WI 53226   (414)456-8765   |  Organon to the Doctor
  47.  
  48.  
  49.